'use strict';

/**
 * Created by twer on 15/3/1.
 */

(function (app) {
    app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
        $routeProvider
            .when('/:userId/blog', {
                templateUrl: '/views/blog/bloglist/blog_list.html',
                controller: 'BlogListCtrl'
            })
            .when('/:userId/blog/category/:categoryId', {
                templateUrl: '/views/blog/bloglist/blog_list.html',
                controller: 'BlogListCtrl'
            })
            .when('/:userId/blog/:blogId', {
                templateUrl: '/views/blog/blogdetail/blog_detail.html',
                controller: 'BlogDetailCtrl'
            })
            .when('/:userId/blog/new/create', {
                templateUrl: '/views/blog/blog_edit.html',
                controller: 'BlogEditCtrl'
            })
            .when('/:userId/blog/edit/:blogId', {
                templateUrl: '/views/blog/blog_edit.html',
                controller: 'BlogEditCtrl'
            })
            .when('/:userId/blog/recyclebin/search', {
                templateUrl: '/views/blog/blogrecycle/blog_recycle.html',
                controller: 'BlogRecycleCtrl'
            })
            .when('/:userId/microblog', {
                templateUrl: '/views/microblog/microblog.html',
                controller: 'MicroBlogListCtrl'
            })
            .when('/:userId/album', {
                templateUrl: '/views/photo/album_list.html',
                controller: 'AlbumListCtrl'
            })
            .when('/:userId/photo/:albumId', {
                templateUrl: '/views/photo/photo_list.html',
                controller: 'PhotoListCtrl'
            })
            .when('/:userId/photo/new/upload', {
                templateUrl: '/views/photo/photo_edit.html',
                controller: 'PhotoNewCtrl'
            })
            .when('/:userId/personalcenter', {
                templateUrl: '/views/personalcenter/personalcenter.html'
            })
            .when('/:userId/personaldocument', {
                templateUrl: '/views/personaldocument/personaldocument.html',
                controller: 'PersonalDocumentCtrl'
            })
            .when('/:userId/space', {
                templateUrl: '/views/space/space.html',
                controller: 'SpaceCtrl'
            })
            .when('/:userId/home', {
                templateUrl: '/views/home/home.html',
                controller: 'HomeCtrl'
            })
            .when('/:userId/friend', {
                templateUrl: '/views/friend/friend.html',
                controller: 'FriendCtrl'
            })
            .when('/:userId/password', {
                templateUrl: '/views/space/password.html',
                controller: 'PasswordCtrl'
            })
            .when('/404', {
                templateUrl: '/views/common/404.html'
            })
            .otherwise({
                redirectTo: '/404'
            });

        $locationProvider.html5Mode(false);
    }]);
})(angular.module('sumerApp'));
